import moment  from "moment"
window.moment = moment
let format = function (val, fmt_str) {
  /**
   * fmt_str 格式为 YYYY MM DD h:mm:ss a
   */
  let time = moment(val)
  return time.format(fmt_str)
}

let to_now_day = function (val) {
  console.log(moment(val))
  console.log(moment())
  return moment(val).diff(moment(), 'days')
}


let gender = function (data) {
  return data ? '男': '女'
}

let paper = function (data) {
  return data ? '身份证': ''
}

let fullImage = function (src) {
  return src ? '' + src : ''
}

export {
  format, to_now_day, gender, paper, fullImage
}